﻿/******************************************************************
** 文 件 名: Bu_AuditBatch_View.aspx.cs
** Copyright (c) 2010-2012 Honestysoft (GuangZhou) Co.,LTD
** 创 建 人: 蔡少鹏
** 创建日期: 2012-3-21 15:53:10
** 描    述: 资金申请批次查看页面
** 版    本: 2.0.0.0
** 修改描述:
** 修 改 人:
** 修改日期:
******************************************************************/
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Honestysoft.BaseObject;
using Honestysoft.Baseframework.WebUI;
using Honestysoft.Financing.Model;
using System.Collections.Generic;


namespace Honestysoft.Financing.WebUI.Module.Audit
{
	public partial class Bu_AuditBatch_View : BasePage
	{	
		protected override void Page_Load(object sender, EventArgs e)
        {
			base.Page_Load(sender, e);
            if (!IsPostBack)
            {
                Bind();
            }
        }

        //protected override void OnInit(EventArgs e)
        //{
        //    base.OnInit(e);
        //    WFButtons1.AfterCall += new WorkFlow_Control_WFButtons.AfterCallEventHandler(WFButtons1_AfterCall);
            
        //}

        //void WFButtons1_AfterCall(Workflow.Model.WFReturn pWFReturn)
        //{
        //    Bind();
        //}		
		/// <summary>
        /// 绑定页面
        /// </summary>
        private void Bind()
        {
           	Bu_AuditBatch obj = new BaseBusinessLogic<Bu_AuditBatch>().GetEntity(Request.QueryString["ID"]);
			if(obj == null){ return; }
			_ID = obj.ID;
			_BatchNo = obj.BatchNo.ToString();
			_PStartDate = obj.PStartDate.HasValue ? obj.PStartDate.Value.ToString("yyyy-MM-dd") : "";
			_PEndDate = obj.PEndDate.HasValue ? obj.PEndDate.Value.ToString("yyyy-MM-dd") : "";
			_StartDate = obj.StartDate.HasValue ? obj.StartDate.Value.ToString("yyyy-MM-dd") : "";
			_EndDate = obj.EndDate.HasValue ? obj.EndDate.Value.ToString("yyyy-MM-dd") : "";
			_Remark = obj.Remark.Replace("\n","<br/>");
            _Creator = new BaseBusinessLogic<Honestysoft.Baseframework.Model.Sys_User>(Globals.CurrentConnStringName).GetEntity(obj.Creator).UserName;
			_CloseUser = obj.CloseUser;
			_CreateTime = obj.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
			_BatchStatus = Honestysoft.EnumHelper.EnumInstance.GetEnumDataText(typeof(EnumItem.BatchStatus), obj.BatchStatus);

            //QueryParameters query = new QueryParameters();
            //query.Add("BatchID", obj.ID, QueryParameters.OperatorType.Equal);
            //List<Bu_BatchContract> lsContract = new BaseBusinessLogic<Bu_BatchContract>(Globals.CurrentConnStringName).GetEntitys(query);
            //List<string> lsConID = new List<string>();
            //if (lsContract != null && lsContract.Count > 0)
            //{
            //    foreach (Bu_BatchContract item in lsContract)
            //    {
            //        lsConID.Add(item.ContractID);
            //    }
            //    DataTable dt = new Honestysoft.Financing.BusinessLogic.Contract(Globals.CurrentConnStringName).GetContractProject(lsConID.ToArray());
            //    rptBatchContract.DataSource = dt;
            //    rptBatchContract.DataBind();
            //}

            //WFButtons1.BillCode = "1001";
            //WFButtons1.EmployeeID = UserLoginer.LoginUser.ID;
            //WFButtons1.BuDataID = obj.ID;
            //WFButtons1.BindWFControl();
        }
		/// <summary>
        /// 标识
        /// </summary>
		protected string _ID = "";
		/// <summary>
        /// 批次
        /// </summary>
		protected string _BatchNo = "";
		/// <summary>
        /// 预计开始时间
        /// </summary>
		protected string _PStartDate = "";
		/// <summary>
        /// 预计结束时间
        /// </summary>
		protected string _PEndDate = "";
		/// <summary>
        /// 开始时间
        /// </summary>
		protected string _StartDate = "";
		/// <summary>
        /// 结束时间
        /// </summary>
		protected string _EndDate = "";
		/// <summary>
        /// 批次说明
        /// </summary>
		protected string _Remark = "";
		/// <summary>
        /// 创建人
        /// </summary>
		protected string _Creator = "";
		/// <summary>
        /// 关闭人
        /// </summary>
		protected string _CloseUser = "";
		/// <summary>
        /// 创建时间
        /// </summary>
		protected string _CreateTime = "";
		/// <summary>
        /// 状态
        /// </summary>
		protected string _BatchStatus = "";
	}
}